package com.hwua.domain;

import java.io.Serializable;
import java.util.Set;

/**
 * 客户的实体类
 * 实现Serializable 就是实现了序列化接口.JAVA中的序列化,实现接口就可以了,没有其它事情要做.
 *
 * implements 读作实现 .
 * @author Administrator
 */
public class Customer implements Serializable {

    private Long cust_id;
    private String cust_name;
    private String cust_source;
    private String cust_industry;
    private String cust_level;
    private String cust_phone;
    private String cust_mobile;

    public Long getCust_id() {
        return cust_id;
    }

    public void setCust_id(Long cust_id) {
        this.cust_id = cust_id;
    }

    public String getCust_name() {
        return cust_name;
    }

    public void setCust_name(String cust_name) {
        this.cust_name = cust_name;
    }

    public String getCust_source() {
        return cust_source;
    }

    public void setCust_source(String cust_source) {
        this.cust_source = cust_source;
    }

    public String getCust_industry() {
        return cust_industry;
    }

    public void setCust_industry(String cust_industry) {
        this.cust_industry = cust_industry;
    }

    public String getCust_level() {
        return cust_level;
    }

    public void setCust_level(String cust_level) {
        this.cust_level = cust_level;
    }

    public String getCust_phone() {
        return cust_phone;
    }

    public void setCust_phone(String cust_phone) {
        this.cust_phone = cust_phone;
    }

    public String getCust_mobile() {
        return cust_mobile;
    }

    public void setCust_mobile(String cust_mobile) {
        this.cust_mobile = cust_mobile;
    }

    public Customer(Long cust_id, String cust_name, String cust_source, String cust_industry, String cust_level, String cust_phone, String cust_mobile) {
        this.cust_id = cust_id;
        this.cust_name = cust_name;
        this.cust_source = cust_source;
        this.cust_industry = cust_industry;
        this.cust_level = cust_level;
        this.cust_phone = cust_phone;
        this.cust_mobile = cust_mobile;
    }

    public Customer(String cust_name, String cust_source, String cust_industry, String cust_level, String cust_phone, String cust_mobile) {
        /*
            因为cust_id 的数据类型是Long,如果直接给0,整数默认是int类型,所以类型不匹配
           (Long)0 Long 是long的引用数据类型,是不可以直接把原生数据类型强转成引用的.
           this() 代表调用本类中其它的构造方法.具体是那一个构造方法,看this()中有那些参数
           因为方法签名确定方法唯一,构造方法的名称是固定的必须和类名一致,剩下只有参数列表了.
         */
        this(0L, cust_name, cust_source, cust_industry, cust_level, cust_phone, cust_mobile);
    }

    /**
     * 有些框架需要通过反射来创建对象.反射一般都使用的是无参构造.
     * 甚至在子类继承父类时,默认调用的就是父类的无参构造.提供一个无参构造保证super()不报错.
     */
    public Customer() {
    }

    /**
     * 为什么要重写toString()方法
     * <p>
     * 如果System.out.println().中println()方法的参数是对象类型,都会选择把该对象转变成String类型,然后在输出
     * 转变方式 是利用Object.toString()方法 .该方法默认打印类名+@+HashCode.重写后改为打印字段的信息
     * <p>
     * 什么情况下需要重写toString()
     * <p>
     * 那些自定义的实体类都需要重写toString()
     *
     * @return
     */
    @Override
    public String toString() {
        return "Customer{" +
                "cust_id=" + cust_id +
                ", cust_name='" + cust_name + '\'' +
                ", cust_source='" + cust_source + '\'' +
                ", cust_industry='" + cust_industry + '\'' +
                ", cust_level='" + cust_level + '\'' +
                ", cust_phone='" + cust_phone + '\'' +
                ", cust_mobile='" + cust_mobile + '\'' +
                '}';
    }
}
